home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1996 June / MACPOWER-1996-06.ISO.7z / MACPOWER-1996-06.ISO / Apple関連 / OpenDoc J-1.0 / 3rd Party Components / Attachmate CyberTerm / TurboTCP 2.0.1 / TurboTCP source / CTCPSessionDoc.h < prev    next >
Text File  |  1994-07-02  |  3KB  |  94 lines

  1. /*
  2. ** CTCPSessionDoc.h
  3. **
  4. **    TurboTCP support library
  5. **    TCP session document
  6. **
  7. **    Copyright ゥ 1993-94, FrostByte Design / Eric Scouten
  8. **
  9. */
  10.  
  11.  
  12. #pragma once
  13.  
  14. #include "CDocument.h"
  15. #include "CFile.h"
  16. #include "CWindow.h"
  17.  
  18. #include "CTCPEndpoint.h"
  19.  
  20.  
  21. /*______________________________________________________________________
  22. **
  23. ** CTCPSessionDoc
  24. **
  25. **    This abstract class is provided to link the TCL CDocument class with the TurboTCP
  26. **    CTCPStream class. View this as a メconnection sessionモ document; this is the point at
  27. **    which the user interaction with the TCP session is handled.
  28. **
  29. **    This class provides all of the necessary behaviors for opening and closing a session.
  30. **    It provides abstract methods for receiving data and handling various TCP notifications.
  31. **    By default, it sets the window title to the name of the remote host. You may also
  32. **    configure it to show the documentユs filename, both hostname & filename, or neither.
  33. **    (See the fields showFileName and showHostName and the method AutoTitle.
  34. **
  35. **    This class does not implement any specific TCP protocol. You will need to subclass it
  36. **    to provide the behaviors specific to the protocol you are implementing. You may want
  37. **    to examine and use the CTelnetTerminal class in MiniTelnet to see how this may be done.
  38. **
  39. **    NOTE: This class is provided only as a convenience. You need not include it in your project.
  40. **    It is retained primarily for compatibility with TurboTCP 1.0.
  41. **
  42. */
  43.  
  44.  
  45. class CTCPSessionDoc : public CDocument, public CTCPEndpoint {
  46.  
  47.     TCL_DECLARE_CLASS;
  48.  
  49.  
  50.     // constructors
  51.     
  52. public:
  53.                                                             // note new parameter sequence
  54.                     CTCPSessionDoc(unsigned short theDefaultPort,
  55.                         unsigned long recBufferSize = recReceiveSize,
  56.                         unsigned short autoReceiveSize = recAutoRecSize,
  57.                         unsigned short autoReceiveNum = recAutoRecNum,
  58.                         Boolean doUseCName = TRUE,
  59.                         Boolean printable = TRUE)
  60.                         : CDocument(printable),
  61.                           CTCPEndpoint(theDefaultPort, recBufferSize, autoReceiveSize,
  62.                               autoReceiveNum, doUseCName)
  63.                           {}
  64.  
  65.     void                ITCPSessionDoc(CApplication* aSupervisor, Boolean printable)
  66.                         { IDocument(aSupervisor, printable); }        // for compatibility only
  67.  
  68.  
  69.     //
  70.     //    TurboTCP 1.0 NOTE: All of the methods which were in CTCPSessionDoc (OpenUserHost,
  71.     //    Close, etc.) are now inherited from CTCPEndpoint instead.
  72.     //
  73.  
  74.     
  75.     // closing windows & sessions
  76.  
  77.     virtual Boolean        Close(Boolean quitting);
  78.     virtual void        RemoteClose();
  79.  
  80.  
  81.     // window titling
  82.  
  83.     virtual void        SetWindowTitle(Str255 newTitle)
  84.                         { if (itsWindow) itsWindow->SetTitle(newTitle); }
  85.     virtual void        GetFileName(Str255 theName)
  86.                         { if (itsFile) itsFile->GetName(theName); else theName[0] = '¥0'; }
  87.  
  88.  
  89.     // CDocument methods which are not implemented here
  90.     
  91.     virtual void        NewFile() {};
  92.     virtual void        OpenFile(SFReply* macSFReply) {};
  93.  
  94. };